Monadic compiler calculation (functional pearl)
نویسندگان
چکیده
Bahr and Hutton recently developed a new approach to calculating correct compilers directly from specifications of their correctness. However, the methodology only considers converging behaviour source language, which means that compiler could potentially produce arbitrary, erroneous code for programs diverge. In this article, we show how can naturally be extended support calculation address both convergent divergent simultaneously , without need separate reasoning each aspect. Our is based on use partiality monad make divergence explicit, together with strong bisimilarity equational-style calculations, but also generalises other forms effect by changing underlying monad.
منابع مشابه
FUNCTIONAL PEARL A type-correct, stack-safe, provably correct expression compiler in Epigram
Conventional approaches to compiler correctness, type safety and type preservation have focused on off-line proofs, either on paper or formalised with a machine, of existing compilation schemes with respect to a reference operational semantics. This pearl shows how the use of dependent types in programming, illustrated here in Epigram, allows us not only to build-in these properties, but to wri...
متن کاملFunctional monadic Heyting algebras
We show every monadic Heyting algebra is isomorphic to a functional monadic Heyting algebra. This solves a 1957 problem of Monteiro and Varsavsky [9].
متن کاملPurely Functional Monadic Scheme
This paper describes a purely functional dialect of the algorithmic programming language Scheme. Mutable variables, assignment operations and impure control operations (call-with-current-continuation) have been omitted, while side effecting input and output operations are incorporated into the purely functional language using monads, similar to the approach taken in the lazy programming languag...
متن کاملFunctional Monadic Bounded Algebras
The variety MBA of monadic bounded algebras consists of Boolean algebras with a distinguished element E, thought of as an existence predicate, and an operator ∃ reflecting the properties of the existential quantifier in free logic. This variety is generated by a certain class FMBA of algebras isomorphic to ones whose elements are propositional functions. We show that FMBA is characterised by th...
متن کاملFUNCTIONAL PEARL InvertingtheBurrowsWheelertransform
The objective of this pearl is to derive the inverse of the Burrows-Wheeler transform from its specification, using simple equational reasoning. In fact, we derive the inverse of a more general version of the transform, proposed by Schindler.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Proceedings of the ACM on programming languages
سال: 2022
ISSN: ['2475-1421']
DOI: https://doi.org/10.1145/3547624